package tests;

import static org.junit.Assert.*;

import java.util.List;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import dao.Dao;

import entites.Domaine;
import entites.GroupeUe;
import entites.Semestre;

import auth.service.User;
import business.semestre.ISemestreManager;


/**
 * @author Olivier SENENTZ
 *
 */
public class TestSemestreManager {

	@SuppressWarnings("unused")
	private static ISemestreManager semestreManager;
	
	private static Dao madao;
	/**
	 * @throws java.lang.Exception
	 */
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		// log
		//log("init");
		// configuration de l'application
		ApplicationContext ctx = new ClassPathXmlApplicationContext("spring-config.xml");
		// couche service
		semestreManager = (ISemestreManager) ctx.getBean("semestreManager");
		madao = new Dao();
	}

	/**
	 * @throws java.lang.Exception
	 */
	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
	}

	/**
	 * @throws java.lang.Exception
	 */
	@After
	public void tearDown() throws Exception {
	}

	/**
	 * Test method for {@link business.semestre.SemestreManager#SemestreManager()}.
	 */
	@Test
	public void testSemestreManager() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link business.semestre.SemestreManager#deleteSemestre(entites.Semestre, java.util.List, auth.service.User)}.
	 */
	@Test
	public void testDeleteSemestre() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link business.semestre.SemestreManager#insertSemestre(entites.Semestre, java.util.List, auth.service.User)}.
	 */
	@Test
	public void testInsertSemestre() {
		Domaine domaine = madao.findDomaine(1);
		Semestre semestre = null;
		User user = null;
		GroupeUe groupeUe = null;
		List<GroupeUe> listGroupeUe = null;
		
		semestre.setCode("MI201");
		semestre.setNbCredits(30);
		semestre.setNumero(1);
		semestre.setDomaine(domaine);

		semestreManager.insertSemestre(semestre, listGroupeUe, user, domaine);
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link business.semestre.SemestreManager#showDashBoardSemestre( auth.service.User , entites.Domaine)}.
	 */
	@Test
	public void testShowDashBoardSemestre() {
		fail("Not yet implemented");
	}
	
	/**
	 * Test method for {@link business.semestre.SemestreManager#updateSemestre(entites.Semestre, entites.Semestre, java.util.List, auth.service.User)}.
	 */
	@Test
	public void testUpdateSemestre() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link business.semestre.SemestreManager#validation(entites.Semestre, auth.service.User)}.
	 */
	@Test
	public void testValidation() {
		fail("Not yet implemented");
	}

}
